<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'menu.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<script type="text/javascript"
	src='<s:url value="/js/jquery-1.8.3.min.js"/>'></script>
<script type="text/javascript">
	function showsubmenu(menuid) {
		$("#img_show_" + menuid).hide();
		$("#img_hide_" + menuid).show();
		$("#tr_" + menuid).show(1000, function() {
			$.ajax({
				type : "POST",
				url : "menu_sub_back.action",
				data : "parentid=" + menuid,
				success : function(msg) {
					$("#td_" + menuid).html(msg);
				}
			});
		});
	}

	function hidesubmenu(menuid) {
		$("#img_show_" + menuid).show();
		$("#img_hide_" + menuid).hide();
		$("#tr_" + menuid).hide();
	}

</script>
</head>

<body>
	<table width="500" border="1">
		<s:iterator value="#request.menulist" var="menu">
			<tr>
				<td><img id="img_show_<s:property value="#menu.menuid" />"
					style="cursor: pointer;" src='<s:url value="/images/lock.png"/>'
					onclick="showsubmenu('<s:property value="#menu.menuid" />');" /><img
					id="img_hide_<s:property value="#menu.menuid" />"
					style="display: none;cursor: pointer;"
					src='<s:url value="/images/lock_open.png"/>'
					onclick="hidesubmenu('<s:property value="#menu.menuid" />');" /></td>

				<td><s:property value="#menu.name" /></td>
			</tr>
			<tr id="tr_<s:property value="#menu.menuid" />"
				style="display: none;">
				<td id="td_<s:property value="#menu.menuid" />" colspan="2"><img
					src='<s:url value="/images/loding.gif"/>'></img></td>
			</tr>
		</s:iterator>
	</table>



</body>
</html>
